<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://sduept.security.el/func"
	template="/template/template.xhtml">
	<ui:define name="head">
		<title>#{request.getParameter('selectName')}厂站内输电设备故障分析</title>
		<link rel="stylesheet"
			href="#{request.contextPath}/resources/plugins/datatables/dataTables.bootstrap.css" />
		<link
			href="#{request.contextPath}/resources/bootstrap/css/bootstrap-datetimepicker.min.css"
			rel="stylesheet" />
		<link
			href="#{request.contextPath}/resources/plugins/bootstrap-select/bootstrap-select.css"
			rel="stylesheet" />
		<link
			href="#{request.contextPath}/resources/plugins/datatables/extensions/Buttons/buttons.dataTables.min.css"
			rel="stylesheet" />
		<link
			href="#{request.contextPath}/resources/plugins/datatables/extensions/ColReorder/css/colReorder.dataTables.min.css"
			rel="stylesheet" />
		<style>

	</style>
	</ui:define>
	
	<ui:define name="content">
		<div class="nav-tabs-custom">
			<ul class="nav nav-tabs pull-left">
				<li class="active"><a href="#pane1" data-toggle="tab">变压器故障分析</a></li>
				<li ><a href="#pane2" id="tab2" onclick="changewidth();" data-toggle="tab">母线故障分析</a></li>
				<!-- <li><a href="#pane3" id="tab3" data-toggle="tab">开关设备异常事件</a></li> -->
			</ul>
			<div class="tab-content no-padding">
				<div class="chart tab-pane active" id="pane1">
					<div class="box box-primary">
						<div style="height: 50px; padding-top: 10px;">
							<h:form id="queryForm">
								<p:outputLabel value="查询时间：" style="margin-left:10px;" />
								<input type="text" id="firstYear" style="width:80px;height:30px;text-align:center;margin-right:5px;" />
								<p:outputLabel value="至 ：" style="margin-left:10px;" />
								<input type="text" id="lastYear" style="width:80px;height:30px;text-align:center;margin-right:5px;" />
								<p:outputLabel value="电压等级：" style="margin-left:10px;" />
								<h:selectOneMenu style="width:110px;height:30px" id="vol">
									<f:selectItem itemValue="0" itemLabel="220kV及以上"/>
									<f:selectItem itemValue="220" itemLabel="220kV"/>
									<f:selectItem itemValue="500" itemLabel="500kV"/>
								</h:selectOneMenu>
								<p:commandButton icon="ui-icon-search" value="查询" style="margin-left:10px;" onclick="initTransmissionFaultTabDatas();" />
							</h:form>
						</div>
					</div>
					<div style="overflow:auto; height: 706px">
						<div class="col-md-12 col-sm-12 no-padding">
							<div class="box box-primary">
								<div class="box-header with-border">
									<h3 id="bianyaqidate" style="margin-left: 10px"
										class="box-title"></h3>
									<p:commandButton value="数据维护" icon="ui-icon-document"
										style="float:right" onclick="PF('dataDlg').show()"
										update="form:dataTable"
										rendered="#{s:hasPermission(session,'tjfx_sbgztjfx_czsdsb_byqsjwh')}" />
								</div>
								<div class="box-body">
									<div id="running" style="height: 300px;"></div>
								</div>
							</div>
						</div>
						<div class="col-md-12 col-sm-12 no-padding">
							<div class="box box-primary">
								<div class="box-header with-border">
									<h3 id="yeardate" class="box-title"></h3>
								</div>
								<div class="box-body">
									<div id="transformer" style="height: 350px; margin: 0 auto;text-align:center;color:grey;font-size:16px;font-weight:bold"></div>
								</div>
							</div>
						</div>
						<div class="col-md-12 col-sm-12 no-padding">
							<div class="box box-primary">
								<div class="box-header with-border">
									<h3 id="electbarid" style="margin-left: 10px" class="box-title">年南方电网变压器故障类型统计</h3>
								</div>
								<div class="box-body">
									<div id="bianyaqi" style="height: 350px; margin: 0 auto;text-align:center;color:grey;font-size:16px;font-weight:bold"></div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="chart tab-pane" id="pane2">
					<div class="box box-primary">
						<div style="height: 50px; padding-top: 10px;">
							<h:form id="queryForm1">
								<p:outputLabel value="查询时间：" style="margin-left:10px;" />
								<input type="text" id="firstYear1" style="width:80px;height:30px;text-align:center;margin-right:5px;" />
								<p:outputLabel value="至 ：" style="margin-left:10px;" />
								<input type="text" id="lastYear1" style="width:80px;height:30px;text-align:center;margin-right:5px;" />
								<p:outputLabel value="电压等级：" style="margin-left:10px;" />
								<h:selectOneMenu style="width:110px;height:30px" id="vol1">
									<f:selectItem itemValue="0" itemLabel="220kV及以上"/>
									<f:selectItem itemValue="220" itemLabel="220kV"/>
									<f:selectItem itemValue="500" itemLabel="500kV"/>
								</h:selectOneMenu>
								<p:commandButton icon="ui-icon-search" value="查询" style="margin-left:10px;" onclick="initBusbarFaultTabDatas();" />
							</h:form>
						</div>
					</div>
					<div style="overflow:auto; height: 706px">
						<div class="col-md-12 col-sm-12 no-padding">
							<div class="box  box-primary">
								<div class="box-header with-border">
									<h3 id="muxiandate" style="margin-left: 10px" class="box-title"></h3>
									<p:commandButton value="数据维护" icon="ui-icon-document"
										style="float:right" onclick="PF('dataDlg1').show()"
										update="form1:dataTable1"
										rendered="#{s:hasPermission(session,'tjfx_sbgztjfx_czsdsb_mxsjwh')}" />
								</div>
								<div class="box-body">
									<div id="muxian" style="height: 300px;"></div>
								</div>
							</div>
						</div>
						<div class="col-md-12 col-sm-12 no-padding">
							<div class="box box-primary">
								<div class="box-header with-border">
									<h3 id="muxianpietitle" class="box-title">母线故障类型分析</h3>
								</div>
								<div class="box-body">
									<div id="muxianpie" style="height: 350px; margin: 0 auto;text-align:center;color:grey;font-size:16px;font-weight:bold"></div>
								</div>
							</div>
						</div>
						<div class="col-lg-12 col-xs-12 no-padding">
							<div class="box box-primary">
								<div class="box-header with-border">
									<h3 id="muxianbartitle" style="margin-left: 10px" class="box-title"></h3>
								</div>
								<div class="box-body">
									<div id="fault-muxian" style="height: 350px; margin: 0 auto;text-align:center;color:grey;font-size:16px;font-weight:bold"></div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!-- <div class="chart tab-pane" id="pane3" style="position: relative">
					<div id="WrapProtectTimeLine" class="col-sm-12 col-lg-12">
						<p:outputLabel value="发生年份 ：" />
						<input type="text" id="exceptionYear_id" onchange="initExceptionDatas()" style="width:60px;text-align:center" />
						<h:selectOneMenu
							id="exceptionYear_id" style="width:130px;margin-right:20px;height:30px">
							<p:ajax event="change" oncomplete="initExceptionDatas()" />
							<f:selectItems value="#{transmissionEquipmentController.exceptionYears}" />
						</h:selectOneMenu>
					</div>
					<div class="row">
						<div class='col-sm-12 col-md-12'>
							<div class='box box-primary'>
								<div class='box-body'>
									<table id="sthtable" class="table table-hover">
									</table>
								</div>
							</div>
						</div>
					</div>
				</div> -->
			</div>
		</div>
		<p:dialog widgetVar="dataDlg" header="变压器数据维护" modal="true"
			id="dataDlg" width="1000" height="400" onHide="initTransmissionFaultTabDatas();">
			<h:form id="form">
				<p:toolbar id="toolbar">
					<f:facet name="left">
						<p:commandButton value="新建" icon="fa fa-plus"
							actionListener="#{transmissionEquipmentController.preCreatTansformerInfo}"
							onclick="PF('createDlg').show()" update="createDlg" />
						<p:commandButton value="编辑" icon="fa fa-pencil"
							actionListener="#{transmissionEquipmentController.editTansformerInfo}"
							disabled="#{transmissionEquipmentController.selectTansformerInfo.id == null}"
							onclick="PF('createDlg').show()" update="createDlg" id="edit" />
						<p:commandButton value="删除" icon="fa fa-trash"
							actionListener="#{transmissionEquipmentController.deleteTansformerInfo}"
							disabled="#{transmissionEquipmentController.selectTansformerInfo.id == null}"
							update="form:dataTable form:msgs form:edit form:delete" id="delete">
							<p:confirm header="提示" message="确定删除该记录吗?" icon="ui-icon-alert" />
						</p:commandButton>
						<p:growl id="msgs" showDetail="true" />
					</f:facet>
				</p:toolbar>
				<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
					<p:commandButton value="是" type="button"
						styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
					<p:commandButton value="否" type="button"
						styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
				</p:confirmDialog>
				<p:dataTable id="dataTable" emptyMessage="无记录"
					value="#{transmissionEquipmentController.tansformerInfos}"
					var="item" rowKey="#{item.id}" rowIndexVar="ite"
					selection="#{transmissionEquipmentController.selectTansformerInfo}"
					paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="20,50,100" paginatorPosition="bottom"
					style="text-align:center;margin-top:3px">
					<f:facet name="{Customization}">
						<p:outputLabel value="总计：#{transmissionEquipmentController.tansformerInfos.size()} 条记录" style="margin-right:20px;" />
					</f:facet>
					<p:ajax event="rowSelectRadio" listener="#{transmissionEquipmentController.onTansformerInfoSelect}" update="form:edit form:delete" />
					<p:column selectionMode="single" width="60" style="text-align:center" />
					<p:column width="60" headerText="序号">
						<h:outputText value="#{ite+1}" />
					</p:column>
					<p:column headerText="年" sortBy="#{item.year}">
						<p:outputLabel value="#{item.year}" />
					</p:column>
					
					<p:column headerText="电压等级">
						<p:outputLabel value="#{item.voltage}" />
					</p:column>
					
					<p:column headerText="总数" sortBy="#{item.count}">
						<p:outputLabel value="#{item.count}" />
					</p:column>
					<p:column headerText="新增加数量" sortBy="#{item.newAdd}">
						<p:outputLabel value="#{item.newAdd}" />
					</p:column>
				</p:dataTable>
			</h:form>
		</p:dialog>
		<p:dialog widgetVar="createDlg" header="数据维护" width="350" height="250">
			<h:form id="createDlg">
				<p:toolbar>
					<f:facet name="left">
						<p:commandButton value="保存" icon="ui-icon-disk"
							onclick="PF('createDlg').hide()"
							actionListener="#{transmissionEquipmentController.saveTansformerInfo}"
							update="form:msgs form:edit form:delete form:dataTable">
						</p:commandButton>
					</f:facet>
				</p:toolbar>
				<p:outputPanel>
					<p:panelGrid columns="2">
						<p:outputLabel value="总数" />
						<p:inputText label="content" value="#{transmissionEquipmentController.tansformerInfo.count}" />
						<p:outputLabel value="年" />
						<p:inputNumber value="#{transmissionEquipmentController.year}" maxValue="2500" thousandSeparator="" decimalPlaces="0"/>
						<p:outputLabel value="电压等级" />
						<h:selectOneMenu value="#{transmissionEquipmentController.voltage}" style="width: 120px;height:30px">
							<f:selectItem itemValue="500" itemLabel="500kV" />
							<f:selectItem itemValue="220" itemLabel="220kV" />
							<f:selectItem itemValue="0" itemLabel="其他" />
						</h:selectOneMenu>
					</p:panelGrid>
				</p:outputPanel>
			</h:form>
		</p:dialog>

		<p:dialog widgetVar="dataDlg1" header="母线数据维护" modal="true"
			id="dataDlg1" width="1000" height="400" onHide="initBusbarFaultTabDatas();">
			<h:form id="form1">
				<p:toolbar id="toolbar1">
					<f:facet name="left">
						<p:commandButton value="新建" icon="fa fa-plus"
							actionListener="#{transmissionEquipmentController.preCreatBusbarInfo}"
							onclick="PF('createDlg1').show()" update="createDlg1" />
						<p:commandButton value="编辑" icon="fa fa-pencil"
							actionListener="#{transmissionEquipmentController.editBusbarInfo}"
							disabled="#{transmissionEquipmentController.selectBusbarInfo.id == null}"
							onclick="PF('createDlg1').show()" update="createDlg1" id="edit1" />
						<p:commandButton value="删除" icon="fa fa-trash"
							actionListener="#{transmissionEquipmentController.deleteBusbarInfo}"
							disabled="#{transmissionEquipmentController.selectBusbarInfo.id == null}"
							update="form1:dataTable1 form1:msgs1 form1:edit1 form1:delete1" id="delete1">
							<p:confirm header="提示" message="确定删除该记录吗?" icon="ui-icon-alert" />
						</p:commandButton>
						<p:growl id="msgs1" showDetail="true" />
					</f:facet>
				</p:toolbar>
				<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
					<p:commandButton value="是" type="button"
						styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
					<p:commandButton value="否" type="button"
						styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
				</p:confirmDialog>
				<p:dataTable id="dataTable1" emptyMessage="无记录"
					value="#{transmissionEquipmentController.busbarInfos}" var="item"
					rowKey="#{item.id}" rowIndexVar="ite"
					selection="#{transmissionEquipmentController.selectBusbarInfo}"
					paginator="true" rows="20"
					paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="20,50,100" paginatorPosition="bottom"
					style="text-align:center;margin-top:3px">
					<f:facet name="{Customization}">
						<p:outputLabel value="总计：#{transmissionEquipmentController.busbarInfos.size()} 条记录" style="margin-right:20px;" />
					</f:facet>
					<p:ajax event="rowSelectRadio" listener="#{transmissionEquipmentController.onRowSelect}" update="form1:edit1 form1:delete1" />
					<p:column selectionMode="single" width="60" style="text-align:center" />
					<p:column width="60" headerText="序号">
						<h:outputText value="#{ite+1}" />
					</p:column>
					<p:column headerText="年" sortBy="#{item.year}">
						<p:outputLabel value="#{item.year}" />
					</p:column>
					<p:column headerText="电压等级" >
						<p:outputLabel value="#{item.voltage}" />
					</p:column>
					<p:column headerText="总数" sortBy="#{item.count}">
						<p:outputLabel value="#{item.count}" />
					</p:column>
					<p:column headerText="新增加数量" sortBy="#{item.newAdd}">
						<p:outputLabel value="#{item.newAdd}" />
					</p:column>
				</p:dataTable>
			</h:form>
		</p:dialog>
		<p:dialog widgetVar="createDlg1" header="母线数据维护" width="350"
			height="250">
			<h:form id="createDlg1">
				<p:toolbar>
					<f:facet name="left">
						<p:commandButton value="保存" icon="ui-icon-disk"
							onclick="PF('createDlg1').hide()"
							actionListener="#{transmissionEquipmentController.saveBusbarInfo}"
							update="form1:msgs1 form1:edit1 form1:delete1 form1:dataTable1">
						</p:commandButton>
					</f:facet>
				</p:toolbar>
				<p:outputPanel>
					<p:panelGrid columns="2">
						<p:outputLabel value="总数" />
						<p:inputText label="content" value="#{transmissionEquipmentController.busbarInfo.count}" />
						<p:outputLabel value="年" />
						<p:inputNumber value="#{transmissionEquipmentController.year}" maxValue="2500" thousandSeparator="" decimalPlaces="0"/>
						<p:outputLabel value="电压等级" />
						<h:selectOneMenu value="#{transmissionEquipmentController.voltage}" style="width: 120px;height:30px">
							<f:selectItem itemValue="500" itemLabel="500kV" />
							<f:selectItem itemValue="220" itemLabel="220kV" />
							<f:selectItem itemValue="0" itemLabel="220kV及以上" />
						</h:selectOneMenu>
					</p:panelGrid>
				</p:outputPanel>
			</h:form>
		</p:dialog>
	</ui:define>
	<ui:define name="contentend">
	    <script src="#{request.contextPath}/resources/js/jquery-migrate.min.js"></script>
		<script src="#{request.contextPath}/resources/js/tables/mytable.js"></script>
		<script
			src="#{request.contextPath}/resources/plugins/datatables/jquery.dataTables.min.js"></script>
		<script
			src="#{request.contextPath}/resources/plugins/datatables/dataTables.bootstrap.min.js"></script>
		<script src="#{request.contextPath}/resources/js/mycharts/charts.js"></script>
		<script
			src="#{request.contextPath}/resources/plugins/echarts/echarts.js"></script>
		<script
			src="#{request.contextPath}/resources/js/mycharts/categoryBarChart.js"></script>
		<script src="#{request.contextPath}/resources/js/array-util.js"></script>
		<script
			src="#{request.contextPath}/resources/plugins/jQueryUI/jquery-ui.js"></script>
		<script
			src="#{request.contextPath}/resources/bootstrap/js/bootstrap-datetimepicker.min.js"></script>
		<script
			src="#{request.contextPath}/resources/bootstrap/js/bootstrap3-typeahead.js"></script>
		<script
			src="#{request.contextPath}/resources/plugins/pinyin/pinyin_dict_firstletter.js"></script>
		<script
			src="#{request.contextPath}/resources/plugins/pinyin/pinyinUtil.js"></script>
		<script
			src="#{request.contextPath}/resources/plugins/bootstrap-select/bootstrap-select.js"></script>
		<script
			src="#{request.contextPath}/resources/plugins/datatables/extensions/Buttons/dataTables.buttons.min.js"></script>
		<script
			src="#{request.contextPath}/resources/plugins/datatables/extensions/Buttons/buttons.colVis.min.js"></script>
		<script
			src="#{request.contextPath}/resources/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.min.js"></script>
		<script src="#{request.contextPath}/resources/js/mycharts/pieChart.js"></script>
		<script src="faultEquipmentStatisticsEcharts.js"></script>
		<script src="transmissionEquipment.js"></script>
	</ui:define>
</ui:composition>
